package com.bop.dehong.decaifu.adapter;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.base.dehong.base.AdapterBase;
import com.base.dehong.util.StringUtils;
import com.bop.dehong.R;
import com.bop.dehong.util.UILRequestManager;

@SuppressLint("InflateParams")
public class AuditImgtAdapter extends AdapterBase<String> {

	public AuditImgtAdapter(Activity context) {
		super(context);
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		// TODO Auto-generated method stub
		ViewHolder holder = null;
		if (convertView == null) {
			holder = new ViewHolder();
			convertView = LayoutInflater.from(mContext).inflate(R.layout.auditimg_list_items, null);
			holder.img = getView(convertView, R.id.audit_img);
			convertView.setTag(holder);
		} else {
			holder = (ViewHolder) convertView.getTag();
		}
		String img = get(position);
		if (StringUtils.isNotEmpty(img)) {
			UILRequestManager.displayImage(img, holder.img);
		}
		return convertView;
	}

	private class ViewHolder {
		private ImageView img;
	}
}
